<?php
namespace Core\CoreContracts;
/*
* TchatMessage class definition
*/
class TchatMessage {

	/**
    * @property integer The tchat message unique identifier
    */
	public $Id;
	
	/**
    * @property User The message sender
    */
	public $User;
	
	/**
    * @property string The message
    */
	public $Message;
	
	/**
    * @property datetime The modification date 
    */
	public $ModificationDate;
	
	/**
    * @property datetime The creation date 
    */
	public $CreationDate;
	
	/**
	* The default constructor
	*/
	public function __construct()  {  }
	
	/*
	* Build a new user object
	*
	* @param string $name The task name
	* @param User $user The user id
	*/
	public static function Create($message, $user)
	{
		$tchatMessage = new TchatMessage();
		$tchatMessage->Message = $message;
		$tchatMessage->User = $user;
		$tchatMessage->ModificationDate = date("Y-m-d H:i:s");
		$tchatMessage->CreationDate = date("Y-m-d H:i:s");
		return $tchatMessage ;
	}
}
?> 